<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:aui="http://liferay.com/faces/aui"
	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:bridge="http://liferay.com/faces/bridge"
	xmlns:p="http://primefaces.org/ui" xmlns:example-cc="http://java.sun.com/jsf/composite/example-cc"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:ms="/functions"
	>
	<h:form>
	 <p:growl id="growl2" showDetail="true" autoUpdate="true"/>  
      <p:commandButton value="Save" actionListener="#{absBean.save}" update="growl2"/>  
	</h:form>
<h:form id="form">  
  
 
 <p:menubar>
  <p:submenu label="Home" icon="ui-icon-home" action="/absence/retards.xhtml">  
          <p:menuitem value="Quit" url="#" icon="ui-icon-close" />   
        </p:submenu>
       
        <p:submenu label="Absence" icon="ui-icon-wrench">  
            <p:menuitem value="Nouveaux" icon="ui-icon-plusthick" action="/absence/absence.xhtml" />  
              
            <p:menuitem value="Liste des absences" url="#" icon="ui-icon-arrowthick-1-s" />  
            <p:separator />  
            <p:menuitem value="Quit" url="#" icon="ui-icon-close"  />  
        </p:submenu>  
  
        <p:submenu label="Retards" icon="ui-icon-wrench">  
            <p:menuitem value="Nouveaux"  action="/absence/retards.xhtml" icon="ui-icon-plusthick" />  
    
            <p:menuitem value="Liste des retards" url="#" icon="ui-icon-arrowthick-1-s" />  
        </p:submenu>  
   <p:submenu label="Remarques" icon="ui-icon-wrench">  
            <p:menuitem value="Nouveaux" url="#" icon="ui-icon-plusthick" action="/absence/remarques.xhtml" />  
            <p:menuitem value="Liste des remarques" url="#" icon="ui-icon-arrowthick-1-s" />  
        </p:submenu> 
          
    </p:menubar> 
	<p:panel>
	
	<p:panel style="background: #f0f3fd;">
Pour ajouter les absences de classe, veuillez saisir les informations ci dessus.</p:panel>
	
	
	
		
	<table style="padding : 20px; margin: 20px; padding-left: 100px">
	
	<tr>



	<td style="padding-right: 4px;">
	<fieldset style="padding: 30px; padding-left: 15px">
 <legend style="font-size:14px;color:black; width: 700px">Absence</legend>
	<table>
	<tr>
	<td style="padding-right: 70px;">
	<h6>Date d'absence</h6>  
	
    <p:calendar id="calendarr" value="#{absBean.abs.dateAbs2}"  required="true"> 
     <p:message id="defaultMessage" for="calendarr" />
    </p:calendar>
     <h:outputText id="out" value="#{absBean.abs.dateAbs}" />  
     </td>
	<td ><h6>Matin ou Apres midi</h6>
 
        <p:selectOneMenu id="periode"  value="#{absBean.abs.periode}" required="true">  
            <f:selectItem itemLabel="Matin/A.midi" itemValue="" />  
            <f:selectItem itemLabel="Matin" itemValue="Matin" />  
            <f:selectItem itemLabel="Apres midi" itemValue="Apres midi" />  
              <p:message id="defaultPer" for="periode" />
        </p:selectOneMenu> 
        </td>
	
	</tr>
	
	</table>
	
    <br />
      
			
<h4>Veuillez choisir les etudiants absents</h4>  

    <p:dataTable id="dataTable" var="Etu" value="#{absBean.etudiantData}" widgetVar="carsTable"   
            emptyMessage="aucun etudiant dans cette classe" selection="#{absBean.selectedEtudiants}" paginator="true" rows="20"
            paginatorPosition="bottom">  
  
          
  <p:column selectionMode="multiple" style="width:18px" /> 
  <p:column id="manufacturerColumn" filterBy="#{Etu.currentClasse.idClasse}"   
                headerText="Classe"  
                filterOptions="#{absBean.classeOptions}"  
                filterMatchMode="exact">  
            <h:outputText value="#{Etu.currentClasse.nameClasse}" />  
        </p:column>  
        
          <p:column id="classeColumn"   
                headerText="Classe">  
            <h:outputText value="#{Etu.currentClasse.nameClasse}" />  
        </p:column>  
        
        <p:column id="modelColumn"   
                headerText="Nom" 
                filterMatchMode="contains">  
            <h:outputText value="#{Etu.user.firstName}" />  
        </p:column>  
  
        <p:column id="yearColumn"  
                headerText="Prenom" >  
            <h:outputText value="#{Etu.user.lastName}" />  
        </p:column>  
                  
        <p:column id="Email"  
                headerText="Email" >  
            <h:outputText value="#{Etu.user.emailAddress}" />  
        </p:column>  
  
    </p:dataTable>  
   
 
		 	
		 
		 <p:dialog id="multiDialog" header="Etudiant Detail" widgetVar="multiCarDialog"   
              height="200"  width="350" showEffect="fade" hideEffect="explode">  
         
  <p:panel style="background: #f0f3fd;">
 Veuillez verifier  de ces informations ci dessus.</p:panel>

  <br />

  
   <h:outputText value="veuillez selectionner un ou plusieurs etudiants"  
                    rendered="#{empty absBean.selectedEtudiants}"  
                    style="font-size:16px; color:red" /> <br />
                    
        <p:dataList id="displayMulti"  
                value="#{absBean.selectedEtudiants}" var="selectedEtu" rendered="#{not empty absBean.selectedEtudiants}">  
               
         <h4>  #{selectedEtu.user.lastName}
         #{selectedEtu.user.firstName}
         Classe:   #{selectedEtu.currentClasse.nameClasse}
         </h4>
        </p:dataList> 
        
         	<p:separator />  
		 <p:commandButton id="ajouter" value="Ajouter" style="float:right"
		    actionListener="#{absBean.save}" update="growl"/>
		    <p:growl id="growl" showDetail="true" autoUpdate="true"/>  
        </p:dialog>
	
	
    
  </fieldset>
   
  </td>
   <td  style="">
  
<fieldset style="padding: 30px; padding-left: 15px">
 <legend style="font-size:14px;color: black;">Autre informations</legend>
        
 <aui:field  label="Justification">
        <p:selectOneMenu  value="#{absBean.abs.justification}">  
            <f:selectItem itemLabel="Oui/Non" itemValue="" />  
            <f:selectItem itemLabel="oui" itemValue="oui" />  
            <f:selectItem itemLabel="non" itemValue="non" />  
         </p:selectOneMenu> 
              </aui:field>
       
             <aui:field  label="Motif">
<p:inputTextarea value="#{absBean.abs.motif}" rows="7" cols="50" counter="counter" maxlength="500"       
    counterTemplate="{0} characters remaining." autoResize="false"/>  
    <h:outputText id="counter" />
</aui:field>
<br />
<table>
	<tr>
	<td style="padding-right: 60px"> 
	
	 <aui:field  label="Du">
<p:selectOneMenu  value="#{absBean.abs.du}">  
            <f:selectItem itemLabel="Select  heure" itemValue="" />  
            <f:selectItem itemLabel="8" itemValue="8" />  
            <f:selectItem itemLabel="9" itemValue="9" />  
            <f:selectItem itemLabel="10" itemValue="10" />  
            <f:selectItem itemLabel="11" itemValue="11" />  
            <f:selectItem itemLabel="12" itemValue="12" />  
            <f:selectItem itemLabel="13" itemValue="13" />  
            <f:selectItem itemLabel="14" itemValue="14" />  
            <f:selectItem itemLabel="15" itemValue="15" />  
            <f:selectItem itemLabel="16" itemValue="16" />  
            <f:selectItem itemLabel="17" itemValue="17" />  
            <f:selectItem itemLabel="18" itemValue="18" />  
              </p:selectOneMenu> 
              </aui:field>
    </td>
              
		<td style=""> 
		
		 <aui:field  label="Au">
        <p:selectOneMenu  value="#{absBean.abs.au}">  
            <f:selectItem itemLabel="Select  heure" itemValue="" />  
            <f:selectItem itemLabel="8" itemValue="8" />  
            <f:selectItem itemLabel="9" itemValue="9" />  
            <f:selectItem itemLabel="10" itemValue="10" />  
            <f:selectItem itemLabel="11" itemValue="11" />  
            <f:selectItem itemLabel="12" itemValue="12" />  
            <f:selectItem itemLabel="13" itemValue="13" />  
            <f:selectItem itemLabel="14" itemValue="14" />  
            <f:selectItem itemLabel="15" itemValue="15" />  
            <f:selectItem itemLabel="16" itemValue="16" />  
            <f:selectItem itemLabel="17" itemValue="17" />  
            <f:selectItem itemLabel="18" itemValue="18" />  
              </p:selectOneMenu> 
              </aui:field>
             
       </td>
	</tr>
	
	</table>
 
      </fieldset>  
        
  

</td>
	
	
	</tr>

	
	</table>
		<p:separator />  
		 <p:commandButton id="pojoSubmit" value="Valider" update="form" oncomplete="multiCarDialog.show()"
		 />
		</p:panel>
   
      
</h:form>

</ui:composition>